Your problem is you are catching the error and then redirecting to the error page, so there is no unhandled error -- meaning no error is bubbling up to cause a ...
Open the desired web.config file. · set the 'mode' attribute of the '<customErrors>' element to 'Off'. · Save the changes and restart your ASP.NET ...